{template 'common/header'}
<script src="https://webapi.amap.com/maps?v=1.4.15&key={php echo $_setting['map_key']}"></script>
<div id="louie" class="row" data-url="{php echo $this->createWebUrl('api')}" data-prev-page="{php echo $this->createWebUrl('activity')}">
    <div id="louie-header">
        <h6 v-if="doing == 'add'">创建活动</h6>
        <h6 v-else>修改活动</h6>
        <a href="{php echo $this->createWebUrl('activity')}" class="btn btn-default btn-sm header-right-btn">活动列表</a>
    </div>

    <form method="post" @submit.prevent="submit" class="col-xs-9 col-lg-9 col-md-9">

        <div class="form-group">
            <label style="display: block;">活动开始时间</label>
            <date-picker v-model="start_date" style="float:left;width:70%;" input-class="form-control" format="yyyy-MM-dd" v-bind:language="date.zh"></date-picker>
            <div style="width:30%;float:left;">
                <select class="form-control" name="start_time" v-model="start_time">
                    <option v-for="item in times" v-bind:value="item" v-bind:selected="item == start_time ? true : false">{{item}}</option>
                </select>
            </div>
        </div>

        <div class="form-group">
            <label style="display: block;">活动结束时间</label>
            <date-picker v-model="end_date" style="float:left;width:70%;" input-class="form-control" format="yyyy-MM-dd" v-bind:language="date.zh"></date-picker>
            <div style="width:30%;float:left;">
                <select class="form-control" name="end_time" v-model="end_time">
                    <option v-for="item in times" v-bind:value="item" v-bind:selected="item == end_time ? true : false">{{item}}</option>
                </select>
            </div>
        </div>

        <div class="form-group">
            <label style="display: block;">是否开启商场模式(多商户模式)</label>
            <select class="form-group" v-model="shop_model" name="open3d" style="width:20%;">
                <option value="0">关闭</option>
                <option value="1">开启</option>
            </select>
        </div>

        <div class="form-group">
            <label>活动地址</label>
            <input type="text" v-model.trim="address" class="form-control" placeholder="活动地址" />
        </div>

        <div class="form-group">
            <label>选择活动区域</label>
            <louie-map v-bind:address="address" v-bind:min-area="min_area" v-bind:m-coords="m_coords" @return-coords="returnCoords" v-bind:show-btn="true"></louie-map>
        </div>

        <button type="submit" class="btn btn-primary">
            <span v-if="doing == 'add'">创建活动</span>
            <span v-else>修改活动</span>
        </button>
    </form>

    <v-dialog style="z-index:99999999999;" />
</div>
<script src="../addons/kuyuan_vbz/dist/web/activity-edit.js"></script>
{template 'common/footer'}
